﻿using System.Windows.Forms;
using System.Diagnostics;

namespace MetadataDocumentationGenerator.Controls
{
    /// <summary>
    /// User control for opening document and saving settings
    /// </summary>
    public partial class Step6 : UserControl
    {
        #region Variables

        /// <summary>
        /// Generation settings
        /// </summary>
        private readonly GenerationSettings _settings;

        #endregion Variables

        #region Constructor

        /// <summary>
        /// Initializes a new instance of class Step6
        /// </summary>
        /// <param name="settings">Generation settings</param>
        /// <param name="filePath">Generated file path</param>
        public Step6(GenerationSettings settings,  string filePath)
        {
            InitializeComponent();

            _settings = settings;
            llDocumentPath.Text = filePath;
        }

        #endregion Constructor

        #region User control handlers

        private void LlDocumentPathLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start(llDocumentPath.Text);
        }

        private void LlSaveSettingsLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            _settings.SaveToFile();
        }

        private void PictureBox1Click(object sender, System.EventArgs e)
        {
            Process.Start("http://mscrmtools.blogspot.com");
        }

        private void PictureBox2Click(object sender, System.EventArgs e)
        {
            Process.Start("http://www.javista.com");
        }

        #endregion Handlers
    }
}
